package com.lhh.company.website.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class SecurityUtils {

    /**
     * 加密对象类
     */
    private static BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(10);

    /**
     * 加密一个密码
     * @param password
     * @return
     */
    public static String encode(String password) {
        return bCryptPasswordEncoder.encode(password);
    }

    /**
     * 返回加密对象
     * @return
     */
    public static BCryptPasswordEncoder getbCryptPasswordEncoder() {
        return bCryptPasswordEncoder;
    }
}
